﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Classes
{
    class Searcher
    {
        IList<City> airports;
        IGraphImpl graph;
        //here I have some fields to work on our own data, of course we will get it rom 
        City aalborg;
        City copenhagen;
        City aarhus;
        City berlin;
        City budapest;
        City sofia;
        City warsaw;
        City vilnus;
        City madrid;
        City moscow;
        City tbilisi;
        City astana;
        public Searcher()

    {
        airports = new List<City>();
         aalborg = new City("Aalborg", "Denmark");
         copenhagen = new City("Copenhagen", "Denmark");
         aarhus = new City("Aarhus", "Demnark");
         berlin = new City("Berlin", "Germany");
         budapest = new City("Budapest", "Romania");
         sofia = new City("Sofia", "Bulagria");
         warsaw = new City("Warsaw", "Poland");
         vilnus = new City("Vilnus", "Lithuania");
         madrid = new City("Madrid", "Spain");
         moscow = new City("Moscow", "Russia");
         tbilisi = new City("Tblisi", "Georgia");
         astana = new City("Astana", "Kazakhstan");


         graph = new GraphImpl();
        

        graph.AddCity(aalborg);
        graph.AddCity(copenhagen);
        graph.AddCity(aarhus);
        graph.AddCity(berlin);
        graph.AddCity(budapest);
        graph.AddCity(sofia);
        graph.AddCity(warsaw);
        graph.AddCity(vilnus);
        graph.AddCity(madrid);
        graph.AddFlight(aalborg, copenhagen);
        graph.AddFlight(aarhus, copenhagen);
        graph.AddFlight(copenhagen, aalborg);
        graph.AddFlight(copenhagen, aarhus);
        graph.AddFlight(copenhagen, berlin);
        graph.AddFlight(aalborg, berlin);
        graph.AddFlight(berlin, moscow);
        graph.AddFlight(moscow, tbilisi);
        graph.AddFlight(tbilisi, astana);
        graph.AddFlight(berlin, copenhagen);
        graph.AddFlight(berlin, budapest);
        graph.AddFlight(berlin, warsaw);
        graph.AddFlight(warsaw, berlin);
        graph.AddFlight(budapest, berlin);
        graph.AddFlight(sofia, budapest);
        graph.AddFlight(berlin, sofia);
        graph.AddFlight(warsaw, vilnus);
        graph.AddFlight(vilnus, warsaw);
        graph.AddFlight(vilnus, berlin);
        graph.AddFlight(berlin, vilnus);
        graph.AddFlight(madrid, berlin);
        graph.AddFlight(berlin, madrid);
        graph.AddFlight(budapest, sofia);
    }
        public void makeASearchInGraph()
        {
            graph.Connection(aarhus, sofia);
            
            //graph.GetCitiesConnection(aalborg);
            
                
            //graph.Dfs(aalborg);

        }
        //here is the method that should take a result of search.
       //in my opinion we should make a method in class GraphImpl that will be taking the data from a results of DFS 
      //and retreive a list of cities and filghts that will be used to create object of Connection class
        public void searchForConnections(City from, City to)
        {
            makeASearchInGraph();
            ListOfConnections listOfConnections = new ListOfConnections();
        }
        
    }
     
}
        /*
        Flight alc = new Flight(aalborg, copenhagen);
        Flight arc = new Flight(aarhus, copenhagen);
        Flight cal = new Flight(copenhagen, aalborg);
        Flight car = new Flight(copenhagen, aarhus);
        Flight cbe = new Flight(copenhagen, berlin);
        Flight albe = new Flight(aalborg, berlin);
        Flight bec = new Flight(berlin, copenhagen);
        Flight bebu = new Flight(berlin, budapest);
        Flight bew = new Flight(berlin, warsaw);
        Flight web = new Flight(warsaw, berlin);
        Flight bube = new Flight(budapest, berlin);
        Flight sbu = new Flight(sofia, budapest);
        Flight bus = new Flight(budapest, sofia);
        Flight sbe = new Flight(sofia, berlin);
        Flight bes = new Flight(berlin, sofia);
        Flight wv = new Flight(warsaw, vilnus);
        Flight vw = new Flight(vilnus, warsaw);
        Flight vbe = new Flight(vilnus, berlin);
        Flight bev = new Flight(berlin, vilnus);
        Flight mbe = new Flight(madrid, berlin);
        Flight bem = new Flight(berlin, madrid);
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         * 
         
             /* Later we will put here some code that will get the info about the graph data from database but for now
        * I'll have my own data
        * */
/*
        City aalborg = new City("Aalborg", "Denmark");
        City copenhagen = new City("Copenhagen", "Denmark");
        City aarhus = new City("Aarhus", "Demnark");
        City berlin = new City("Berlin", "Germany");
        City budapest = new City("Budapest", "Romania");
        City sofia = new City("Sofia", "Bulagria");
        City warsaw = new City("Warsaw", "Poland");
        City vilnus = new City("Vilnus", "Lithuania");
        City madrid = new City("Madrid", "Spain");
        City moscow = new City("Moscow", "Russia");
        City tbilisi = new City("Tblisi", "Georgia");
        City astana = new City("Astana", "Kazakhstan");


         graph = new GraphImpl();
        /* we will have some for each loop here to create graph with flights and edges and cities but for now I will do it manually
         * */

      /*  graph.AddCity(aalborg);
        graph.AddCity(copenhagen);
        graph.AddCity(aarhus);
        graph.AddCity(berlin);
        graph.AddCity(budapest);
        graph.AddCity(sofia);
        graph.AddCity(warsaw);
        graph.AddCity(vilnus);
        graph.AddCity(madrid);
        graph.AddFlight(aalborg, copenhagen);
        graph.AddFlight(aarhus, copenhagen);
        graph.AddFlight(copenhagen, aalborg);
        graph.AddFlight(copenhagen, aarhus);
        graph.AddFlight(copenhagen, berlin);
        graph.AddFlight(aalborg, berlin);
        graph.AddFlight(berlin, moscow);
        graph.AddFlight(moscow, tbilisi);
        graph.AddFlight(tbilisi, astana);
        graph.AddFlight(berlin, copenhagen);
        graph.AddFlight(berlin, budapest);
        graph.AddFlight(berlin, warsaw);
        graph.AddFlight(warsaw, berlin);
        graph.AddFlight(budapest, berlin);
        graph.AddFlight(sofia, budapest);
        graph.AddFlight(berlin, sofia);
        graph.AddFlight(warsaw, vilnus);
        graph.AddFlight(vilnus, warsaw);
        graph.AddFlight(vilnus, berlin);
        graph.AddFlight(berlin, vilnus);
        graph.AddFlight(madrid, berlin);
        graph.AddFlight(berlin, madrid);
        graph.AddFlight(budapest, sofia);
    }
        public void createTheGraph()
        {
           
            

            graph.Dfs(aalborg);

        }
          
         
        */